package oracle.apps.financials.collection.fragment;

import oracle.apps.financials.collection.activity.TopDelinquentCustomerActivity;
import oracle.apps.financials.collection.po.Customer;
import android.app.Fragment;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.cyrilmottier.android.greendroid.R;

public class BaseGraphFragment extends Fragment {

	protected Customer customer;
	protected Handler mHandler;
	public static final String TAG = BaseGraphFragment.class.getSimpleName();

	public BaseGraphFragment() {
		super();
	}

	public BaseGraphFragment(Customer customer) {
		this(customer, null);
	}

	public BaseGraphFragment(Customer customer, Handler mHandler) {
		super();
		this.customer = customer;
		this.mHandler = mHandler;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		return inflater.inflate(R.layout.percent_current_graph, container, false);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

	}

	public void refreshGraphView(Customer customer) {
		this.customer = customer;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public void notifyHandler(Customer customer) {
		Message message = new Message();
		message.what = 1;
		message.obj = customer;
		mHandler.sendMessage(message);
	}

}
